/*
  ==============================================================================

  This is an automatically generated file created by the Jucer!

  Creation date:  6 Jun 2008 6:38:18 pm

  Be careful when adding custom code to these files, as only the code within
  the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  and re-saved.

  Jucer version: 1.11

  ------------------------------------------------------------------------------

  The Jucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-6 by Raw Material Software ltd.

  ==============================================================================
*/

//[Headers] You can add your own extra header files here...
//[/Headers]

#include "KetonalInputDialogComponent.h"


//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]

//==============================================================================
KetonalInputDialogComponent::KetonalInputDialogComponent (XmlElement *e)
    : fieldValue2 (0),
      fieldName2 (0),
      label (0),
      label2 (0),
      okButton (0)
{
    addAndMakeVisible (fieldValue2 = new TextEditor (T("new text editor")));
    fieldValue2->setMultiLine (false);
    fieldValue2->setReturnKeyStartsNewLine (false);
    fieldValue2->setReadOnly (false);
    fieldValue2->setScrollbarsShown (true);
    fieldValue2->setCaretVisible (true);
    fieldValue2->setPopupMenuEnabled (true);
    fieldValue2->setColour (TextEditor::shadowColourId, Colour (0x0));
    fieldValue2->setText (String::empty);

    addAndMakeVisible (fieldName2 = new TextEditor (T("new text editor")));
    fieldName2->setMultiLine (false);
    fieldName2->setReturnKeyStartsNewLine (false);
    fieldName2->setReadOnly (false);
    fieldName2->setScrollbarsShown (true);
    fieldName2->setCaretVisible (true);
    fieldName2->setPopupMenuEnabled (true);
    fieldName2->setColour (TextEditor::shadowColourId, Colour (0x0));
    fieldName2->setText (String::empty);

    addAndMakeVisible (label = new Label (T("new label"),
                                          T("Field Name")));
    label->setFont (Font (12.0000f, Font::plain));
    label->setJustificationType (Justification::centredLeft);
    label->setEditable (false, false, false);
    label->setColour (TextEditor::textColourId, Colours::black);
    label->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label2 = new Label (T("new label"),
                                           T("Field Value")));
    label2->setFont (Font (12.0000f, Font::plain));
    label2->setJustificationType (Justification::centredLeft);
    label2->setEditable (false, false, false);
    label2->setColour (TextEditor::textColourId, Colours::black);
    label2->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (okButton = new TextButton (T("OK")));
    okButton->addButtonListener (this);


    //[UserPreSize]
    //[/UserPreSize]

    setSize (256, 280);

    //[Constructor] You can add your own custom stuff here..
    //[/Constructor]
}

KetonalInputDialogComponent::~KetonalInputDialogComponent()
{
    //[Destructor_pre]. You can add your own custom destruction code here..
    //[/Destructor_pre]

    deleteAndZero (fieldValue2);
    deleteAndZero (fieldName2);
    deleteAndZero (label);
    deleteAndZero (label2);
    deleteAndZero (okButton);

    //[Destructor]. You can add your own custom destruction code here..
    //[/Destructor]
}

//==============================================================================
void KetonalInputDialogComponent::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    GradientBrush gradient_1 (Colour (0xffcecece),
                              136.0f, 144.0f,
                              Colour (0xffa1a1a1),
                              256.0f, 280.0f,
                              true);
    g.setBrush (&gradient_1);
    g.fillRoundedRectangle (0.0f, 0.0f, 256.0f, (float) (proportionOfHeight (1.0000f)), 10.0000f);

    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}

void KetonalInputDialogComponent::resized()
{
    fieldValue2->setBounds (16, 80, 224, 160);
    fieldName2->setBounds (16, 32, 224, 24);
    label->setBounds (16, 16, 168, 16);
    label2->setBounds (16, 64, 168, 16);
    okButton->setBounds (160, 256, 80, 16);
    //[UserResized] Add your own custom resize handling here..
    //[/UserResized]
}

void KetonalInputDialogComponent::buttonClicked (Button* buttonThatWasClicked)
{
    //[UserbuttonClicked_Pre]
    //[/UserbuttonClicked_Pre]

    if (buttonThatWasClicked == okButton)
    {
        //[UserButtonCode_okButton] -- add your button handler code here..
        //[/UserButtonCode_okButton]
    }

    //[UserbuttonClicked_Post]
    //[/UserbuttonClicked_Post]
}



//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
//[/MiscUserCode]


//==============================================================================
#if 0
/*  -- Jucer information section --

    This is where the Jucer puts all of its metadata, so don't change anything in here!

BEGIN_JUCER_METADATA

<JUCER_COMPONENT documentType="Component" className="KetonalInputDialogComponent"
                 componentName="" parentClasses="public Component" constructorParams="XmlElement *e"
                 variableInitialisers="" snapPixels="8" snapActive="1" snapShown="1"
                 overlayOpacity="0.330000013" fixedSize="1" initialWidth="256"
                 initialHeight="280">
  <BACKGROUND backgroundColour="c1c1ff">
    <ROUNDRECT pos="0 0 256 100%" cornerSize="10" fill=" radial: 136 144, 256 280, 0=ffcecece, 1=ffa1a1a1"
               hasStroke="0"/>
  </BACKGROUND>
  <TEXTEDITOR name="new text editor" id="6d3f006f503c17e" memberName="fieldValue2"
              virtualName="" explicitFocusOrder="0" pos="16 80 224 160" shadowcol="0"
              initialText="" multiline="0" retKeyStartsLine="0" readonly="0"
              scrollbars="1" caret="1" popupmenu="1"/>
  <TEXTEDITOR name="new text editor" id="e60f4a3f54e012d6" memberName="fieldName2"
              virtualName="" explicitFocusOrder="0" pos="16 32 224 24" shadowcol="0"
              initialText="" multiline="0" retKeyStartsLine="0" readonly="0"
              scrollbars="1" caret="1" popupmenu="1"/>
  <LABEL name="new label" id="57ca81d95e371260" memberName="label" virtualName=""
         explicitFocusOrder="0" pos="16 16 168 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Field Name" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="33"/>
  <LABEL name="new label" id="44baf3914cd90a8a" memberName="label2" virtualName=""
         explicitFocusOrder="0" pos="16 64 168 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Field Value" editableSingleClick="0"
         editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
         fontsize="12" bold="0" italic="0" justification="33"/>
  <TEXTBUTTON name="OK" id="c5c0d999c65e145a" memberName="okButton" virtualName=""
              explicitFocusOrder="0" pos="160 256 80 16" buttonText="OK" connectedEdges="0"
              needsCallback="1" radioGroupId="0"/>
</JUCER_COMPONENT>

END_JUCER_METADATA
*/
#endif
